<?php
require_once ('library/Zend/Db/Table/Abstract.php');
/**
 * Clase para manejar las conexiones a bases de datos externas
 * @author Victor Cardenas
 */
abstract class Model_DbTableExternal extends Zend_Db_Table_Abstract {

    abstract function getDatabaseParams();

    /* (non-PHPdoc)
	 * @see Zend_Db_Table_Abstract::_setupDatabaseAdapter()
	 */
    protected function _setupDatabaseAdapter() {
        if(! $this->_db) {
            $options = array(
                Zend_Db::AUTO_QUOTE_IDENTIFIERS=>false,
                Zend_Db::CASE_FOLDING=>2
            );
            //$params = $this->getDatabaseParams();
            $params = array(
                'host'=>'192.168.0.11',
            	'username'=>'CUN',
            	'password'=>'123456',
                'dbname'=>'XE',
            	'charset'=>'AL32UTF8',
                'persistent'=>false,
                'options'=>$options
            );
            $this->_db = Zend_Db::factory('pdo_oci', $params);
            
            if(! $this->_db instanceof Zend_Db_Adapter_Abstract) {
                require_once 'Zend/Db/Table/Exception.php';
                throw new Zend_Db_Table_Exception('No adapter found for ' . get_class($this));
            }
        }
    }
}
?>